<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IFWiki.Models.History>" %>

<asp:Content ID="Content4" ContentPlaceHolderID="head" runat="server">
	<title>Revisions of <%= Html.Encode(Model.Name) %></title>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="menu" runat="server">
        <div id="menucontainer">
            <ul id="menu">              
                <li><%= Html.ActionLink("Main", "Index", "History", new { name = Model.Name }, null)%></li>
                <li><a class="current">Source</a></li>                                                                
<%    
    if (Html.ViewData.Model.IsDiscussion)  
    {
%>
                <li><%= Html.ActionLink("UnTalk", "UnTalk", "Article", new { name = Model.Name }, null)%></li>
<%
    }
    else
    {
%> 
                <li><%= Html.ActionLink("Talk", "Talk", "Article", new { name = Model.Name, innerType = Model.InnerType  }, null)%></li>
<%
    }
%>
            </ul>
        </div>
   </div>
</asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

            <div id="submenucontainer">
                <ul id="submenu">              
                <li><%= Html.ActionLink("Source", "ViewSource", Model.InnerType, new { name = Model.Name }, null)%></li>
<%
    if (Request.IsAuthenticated)
    {
%>
                    <li><%= Html.ActionLink("Edit", "Edit", Model.InnerType, new { name = Model.Name }, null)%></li>
<%
    }
%>                    


                <li><a class="current">History</a></li>                                                
                </ul>
            </div>

    <h2>Revisions of <%= Html.Encode(Model.Name) %></h2>
    

 <table>
        <tr>
            <th></th>
            <th>
                Reason
            </th>
            
            <th>
                When
            </th>
            <th>
                Who
            </th>
            <th>
            </th>
        </tr>

    
<% foreach (var item in Model.Revisions) { %>

        <tr>
            <td></td>
            <td>
                <%= Html.Encode(item.Reason) %>
            </td>
            <td>
                <%= Html.Encode(item.RevisedAt) %>
            </td>
            <td>
                <%= Html.Encode(item.RevisedBy) %>
            </td>            
            <td>

<%
    if (Request.IsAuthenticated)
    {
%>
                <%= Html.ActionLink("(revert)", "Revert", Model.InnerType, new { name = Model.Name, revisedAt = item.RevisedAt }, null)%>
<%                
    }
%>
                <%= Html.ActionLink("(view)", "ViewRevision", Model.InnerType, new { name = Model.Name, revisedAt = item.RevisedAt }, null)%>
                
                
            </td>            
            
        </tr>

      
<% } %>
</table>    

<%
    if (!Request.IsAuthenticated)
    {
%>
    <p class="note"><%= Html.ActionLink("Login", "Login", "Account", null, null) %>  to allow revert.</p>

<% } %>


</asp:Content>

